#ifndef T_BOX_H
#define T_BOX_H

#include "stable.h"

class T_Box
{
public:
    enum
    {
        PLAYER_HEAD_HEADGE = 2000,
        PLAYER_BUFFER_TIME = 6000,
        PLAYER_AHEAD_IMAGE  = NUM_AHEAD_IMAGES,
        PLAYER_ENOUGH_IMAGE = NUM_AHEAD_IMAGES*2,
        PLAYER_IMAGE_STOCK  = NUM_AHEAD_IMAGES*4,
    };
    explicit T_Box();
};

class T_Box_Thread : public QThread
{
public:
    explicit T_Box_Thread(QObject *parent = 0);
    void start();
    void finish();
protected:
    bool &f_ready();
    bool &f_closing();
private:
    void p_reset_status();
    void p_wait_ready();
    void p_wait_closing();
private:
    bool m_ready;
    bool m_closing;
};

#endif // T_BOX_H
